<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var reg = /a*frank/g;
    var s = 'frank afrank aafrank aaafrank';

    var r = s.match(reg);
    console.log(r);
</script>
</body>
</html>